package com.content.view.Frame.CBar
{
	import com.content.model.LoadedAssets.SkinProxy;
	import com.content.view.Component.CButton.CButtonLevel1;
	import com.content.view.Component.CButton.Level1VO;
	import com.content.view.Component.Toggle.ToggleGroupManager;
	import com.library.core.IDisposable;
	import com.library.core.UIObject;
	import com.library.utils.Geometry;
	
	import flash.display.BitmapData;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.DataEvent;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Matrix;
	
	import gs.TweenLite;
	
	public class CBar extends UIObject implements IDisposable
	{
		public static const NAME:String							= 'CBar';
		
		public static const SHOW:String							= NAME + "-" + 'Show';
		public static const HIDE:String							= NAME + "-" + 'Hide';
		public static const INIT:String							= NAME + "-" + 'Init';
		
		private var _cBarL1:CBarLevel1;
		private var _cBarL2:CBarLevel2;
		
		public function CBar(cBarL1Width:int, cBarL1MarginLeft:int, cBarL2Width:int, cBarL2BtnMarginH:int, cBarL2BtnMarginV:int, cBarL2BtnHeight:int)
		{
			_cBarL2 = new CBarLevel2(	cBarL2Width,
										cBarL1Width + cBarL1MarginLeft,
										cBarL2BtnMarginH,
										cBarL2BtnMarginV,
										cBarL2BtnHeight);
			addChild(_cBarL2);
			
			_cBarL1 = new CBarLevel1(cBarL1Width, cBarL1MarginLeft);
			addChild(_cBarL1);
		}
		
		/* Public Method
		* ---------------------------------------------------- */
		public function Init(cBtnVOList:Array, pSkin:SkinProxy):void{
			// 由于 Default MP会在 cBarL1中发出 CHOOSE_CBUTTON 事件选择 C2，所以 C2必须提前 Init
			_cBarL2.Init(pSkin);
			_cBarL1.Init(cBtnVOList, pSkin);
		}
		public function SetLayout(sHeight:int):void{
			
			_cBarL1.SetLayout(sHeight);
			_cBarL2.SetLayout(sHeight);
		}
		public function ShowL1(delay:Number = 0, duration:Number = 0.5):void{
			_cBarL1.Show(delay, duration);
		}		
		public function ShowL2(l1VO:Level1VO):void{
			_cBarL2.Show(l1VO);
		}		
		public function HideL1():void{
			_cBarL1.Hide();
		}
		public function HideL2():void{
			_cBarL2.Hide();
		}
		public function Dispose():void
		{
			_cBarL1.Dispose();
		}
	}
}